<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>代码生成器</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
<link rel="stylesheet" th:href="@{/css/font-awesome.min.css}">
<link rel="stylesheet" th:href="@{/plugins/jqgrid/ui.jqgrid-bootstrap.css}">
<link rel="stylesheet" th:href="@{/css/main.css}">

<script th:src="@{/libs/jquery.min.js}"></script>
<script th:src="@{/plugins/layer/layer.js}"></script>
<script th:src="@{/libs/bootstrap.min.js}"></script>
<script th:src="@{/libs/vue.min.js}"></script>
<script th:src="@{/plugins/jqgrid/grid.locale-cn.js}"></script>
<script th:src="@{/plugins/jqgrid/jquery.jqGrid.min.js}"></script>
<script th:src="@{/js/common.js}"></script>
<script>
	var ctx = /*[[@{/}]]*/ '';
</script>
<style>
	.form-group {
		margin-bottom: 2px;
	}
	.form-group label{
		text-align: right;
		width: 140px;
	}
</style>
</head>
<body>
<div id="rrapp">
	<div class="grid-btn">
		<div class="form-group col-sm-2">
			<input type="text" class="form-control" v-model="q.tableName" @keyup.enter="query" placeholder="表名&表备注">
		</div>
		<a class="btn btn-default" @click="query">查询</a>
		<a class="btn btn-primary" @click="generator"><i class="fa fa-file-code-o"></i>&nbsp;生成代码</a>
	</div>
    <table id="jqGrid"></table>
    <div id="jqGridPager"></div>
</div>

<div id="outDirTemplate" style="display: none">
	<div class="form-group col-sm-12">
		<label style="float: left;margin-top: 7px;">模块名称：</label>
		<div class="col-sm-9">
			<input style="width: 100px;float: left" type="text" class="form-control" id="moduleName">
			<label style="margin-top: 8px;margin-left: 10px;width: 550px;text-align: left">默认取表的前缀做模块简称，可自定义，用于生成java包名</label>
		</div>
	</div>
	<div class="form-group col-sm-12">
		<label style="float: left;margin-top: 7px;">表名前缀：</label>
		<div class="col-sm-9">
			<input style="width: 100px;float: left" type="text" class="form-control" id="tablePrefix">
			<label style="margin-top: 8px;margin-left: 10px;width: 550px;text-align: left">因为生成类名以表名为准，通常需要去除表名前缀，这里会匹配表名包含此值剔除</label>
		</div>
	</div>
	<div class="form-group col-sm-12">
		<label style="float: left;margin-top: 7px;">表名后缀：</label>
		<div class="col-sm-9">
			<input style="width: 100px;float: left" type="text" class="form-control" id="tableSuffix">
			<label style="margin-top: 8px;margin-left: 10px;width: 550px;text-align: left">这里会匹配表名包含此值剔除</label>
		</div>
	</div>
	<div class="form-group col-sm-12" style="height: 35px;">
		<label style="float: left;margin-top: 7px;">发布为rpc服务：</label>
		<div class="col-sm-9">
			<select class="form-control" id="rpc" style="width: 150px;float: left;">
				<option value="false">否</option>
				<option value="true">是</option>
			</select>
			<label style="margin-top: 8px;margin-left: 10px;width: 550px;text-align: left">rpc会额外生成Dto在entity包，RpcServiceImpl在service包，请自行转移到公共依赖包</label>
		</div>
	</div>
	<div class="form-group col-sm-12" style="height: 35px;">
		<label style="float: left;margin-top: 7px;">生成结果：</label>
		<div class="col-sm-9">
			<select class="form-control" id="package" style="width: 150px;">
				<option value="dir">输出到目录</option>
				<option value="zip">ZIP打包</option>
			</select>
			<label style="margin-top: 8px;margin-left: 10px"></label>
		</div>
	</div>
	<div id="params">
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">项目主目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="${runingDir}" class="form-control" id="mainOutPath" placeholder="entity输出目录">
			</div>
		</div>
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">DO输出目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="'{项目主目录}'+${fileDir}+'/entity'" class="form-control" id="entityOutPath" placeholder="entity输出目录">
			</div>
		</div>
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">DTO输出目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="'{项目主目录}'+${fileDir}+'/dto'" class="form-control" id="dtoOutPath" placeholder="dto输出目录">
			</div>
		</div>
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">dao输出目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="'{项目主目录}'+${fileDir}+'/dao'" class="form-control" id="daoOutPath" placeholder="dao输出目录">
			</div>
		</div>
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">bo输出目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="'{项目主目录}'+${fileDir}+'/bo'" class="form-control" id="boOutPath" placeholder="bo输出目录">
			</div>
		</div>
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">service输出目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="'{项目主目录}'+${fileDir}+'/service'" class="form-control" id="serviceOutPath" placeholder="service输出目录">
			</div>
		</div>
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">controller输出目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="'{项目主目录}'+${fileDir}+'/controller'" class="form-control" id="controllerOutPath" placeholder="controller输出目录">
			</div>
		</div>
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">mapper输出目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="'{项目主目录}'+${resourcesDir}+'mapper'" class="form-control" id="mapperOutPath" placeholder="mapper输出目录">
			</div>
		</div>
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">静态资源输出目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="'{项目主目录}'+${resourcesDir}+'statics/js/modules/{moduleName}'" class="form-control" id="staticOutPath" placeholder="mapper输出目录">
				<!--<input type="text" val="" class="form-control" id="staticOutPath" placeholder="mapper输出目录">-->
			</div>
		</div>
		<div class="form-group col-sm-12">
			<label style="float: left;margin-top: 7px;">页面输出目录：</label>
			<div class="col-sm-9">
				<input type="text" th:val="'{项目主目录}'+${resourcesDir}+'templates/modules/{moduleName}'" class="form-control" id="htmlOutPath" placeholder="mapper输出目录">
				<!--<input type="text" val="" class="form-control" id="htmlOutPath" placeholder="mapper输出目录">-->
			</div>
		</div>
	</div>
</div>
<script th:src="@{/js/generator.js}"></script>
</body>
</html>